package basetest;

import org.junit.Test;
import utils.JDBCUtils;

import java.sql.*;


public class UpdateTest {
    @Test
    public void test() {
        Connection connection = null;
        PreparedStatement ps = null;
        try {
            connection = JDBCUtils.getConnection();
            String sql = "UPDATE new_table2 SET first_name=? WHERE employee_id=?;";
            ps = connection.prepareStatement(sql);
            ps.setString(1, "Amy");
            ps.setInt(2, 1000);
            ps.execute();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            JDBCUtils.closeSource(connection);
            JDBCUtils.closeSource(ps);
        }
    }
}
